package logic

import (
	. "leaf/common"
	"leaf/core"
	"leaf/core/conf"
	"leaf/core/gate"
	"leaf/server/logic/handle"
	"leaf/server/logic/rpc"
)

func Run(path string) {
	//初始化配置，log
	closer := core.Init(path, SERVER_TYPE_MAP)
	if closer != nil {
		defer closer()
	}
	//初始化handle
	handle.Init()
	//初始化rpc
	rpc.Init()

	core.Run(gate.NewGate(conf.Config.WSAddr))
}
